<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title>编辑功能</title>
    <link rel="stylesheet" type="text/css" href="/static/layui/css/layui.css" />
    <style>
        .wrap-container { padding-top: 16px; }
        .layui-form { width: 90%; margin: 0 auto; }
        .layui-form-item .layui-input-block { margin-left: 160px; }
        .layui-form-label { width: 130px; }
    </style>
</head>
<body>
    <div class="wrap-container">
        <form class="layui-form" id="functionForm">
            <input type="hidden" name="id" value="{{ function.id }}">
            <div class="layui-form-item">
                <label class="layui-form-label">功能项</label>
                <div class="layui-input-block">
                    <input type="text" name="function" required placeholder="请输入功能" class="layui-input" maxlength="32" value="{{ function.name }}">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">功能说明</label>
                <div class="layui-input-block">
                    <input type="text" name="description"  placeholder="请输入功能说明" class="layui-input" maxlength="64" value="{{ function.desc }}">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">Item(功能域)</label>
                <div class="layui-input-block">
                    <select name="domain" lay-verify="required" lay-filter="domainSelect">
                        <option value="">请选择功能域</option>
                        {% for item in items %}
                        <option value="{{ item.id }}" {% if item.id == function.func_domain_id %}selected{% endif %}>{{ item.name }}</option>
                        {% endfor %}
                    </select>
                </div>
            </div>
            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label">基本数据流</label>
                <div class="layui-input-block">
                    <textarea name="dataFlow" placeholder="以一键启动为例: 启动按钮—>BCM—>GW—>EMS—>起动机" class="layui-textarea">{{ function.data_flow }}</textarea>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">是否EE架构组件</label>
                <div class="layui-input-block">
                    <input type="checkbox" name="isEEComponent" lay-skin="switch" lay-text="是|否" {% if function.bool_ee=='Y' %}checked{% endif %}>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">是否影响功能安全</label>
                <div class="layui-input-block">
                    <input type="checkbox" name="isSafetyRelevant" lay-skin="switch" lay-text="是|否" {% if function.bool_safe=='Y' %}checked{% endif %}>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">是否处理敏感数据</label>
                <div class="layui-input-block">
                    <input type="checkbox" name="isDataSensitive" lay-skin="switch" lay-text="是|否" {% if function.bool_userdata=='Y' %}checked{% endif %}>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">是否基于网络化实现</label>
                <div class="layui-input-block">
                    <input type="checkbox" name="isNetworkBased" lay-skin="switch" lay-text="是|否" {% if function.bool_network=='Y' %}checked{% endif %}>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">责任人</label>
                <div class="layui-input-block">
                    <input type="text" name="contact_person"  placeholder="请输入责任人" class="layui-input" maxlength="32" value="{{ function.contact_person if function.contact_person is not none else ''  }}">
                </div>
            </div>
        </form>
    </div>

    <script src="/static/layui/layui.js" type="text/javascript" charset="utf-8"></script>
    <script>
        layui.use(['form', 'jquery'], function(){
            var form = layui.form;
            var $ = layui.jquery;

            // 表单初始化
            form.render();
        });
    </script>
</body>
</html>